<?php
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者，助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件，未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
use think\facade\Route;

Route::group('jingpai', function () {

    Route::get('category', 'v1.jingpai.jingpaiCategory/index')->option(['real_name' => '竞拍分类列表']);
    //竞拍树形列表
    Route::get('category/tree/:type', 'v1.jingpai.jingpaiCategory/tree_list')->option(['real_name' => '竞拍分类树形列表']);
    //竞拍分类新增表单
    Route::get('category/create', 'v1.jingpai.jingpaiCategory/create')->option(['real_name' => '竞拍分类新增表单']);
    //竞拍分类新增
    Route::post('category', 'v1.jingpai.jingpaiCategory/save')->option(['real_name' => '竞拍分类新增']);
    //竞拍分类编辑表单
    Route::get('category/:id', 'v1.jingpai.jingpaiCategory/edit')->option(['real_name' => '竞拍分类编辑表单']);
    //竞拍分类编辑
    Route::put('category/:id', 'v1.jingpai.jingpaiCategory/update')->option(['real_name' => '竞拍分类编辑']);
    //删除竞拍分类
    Route::delete('category/:id', 'v1.jingpai.jingpaiCategory/delete')->option(['real_name' => '删除竞拍分类']);
    //竞拍分类修改状态
    Route::put('category/set_show/:id/:is_show', 'v1.jingpai.jingpaiCategory/set_show')->option(['real_name' => '竞拍分类修改状态']);
    //竞拍分类快捷编辑
    Route::put('category/set_category/:id', 'v1.jingpai.jingpaiCategory/set_category')->option(['real_name' => '竞拍分类快捷编辑']);
    //竞拍列表
    Route::get('jingpai', 'v1.jingpai.jingpaiProduct/index')->option(['real_name' => '竞拍列表']);
    //获取退出未保存的数据
    Route::get('cache', 'v1.jingpai.jingpaiProduct/getCacheData')->option(['real_name' => '获取退出未保存的数据']);
    //1分钟保存一次数据
    Route::post('cache', 'v1.jingpai.jingpaiProduct/saveCacheData')->option(['real_name' => '保存还未提交数据']);
    //获取所有竞拍列表
    Route::get('jingpai/list', 'v1.jingpai.jingpaiProduct/search_list')->option(['real_name' => '获取所有竞拍列表']);
    //获取竞拍规格
    Route::get('jingpai/attrs/:id/:type', 'v1.jingpai.jingpaiProduct/get_attrs')->option(['real_name' => '获取竞拍规格']);
    //竞拍列表头
    Route::get('jingpai/type_header', 'v1.jingpai.jingpaiProduct/type_header')->option(['real_name' => '竞拍列表头部数据']);
    //竞拍详情
    Route::get('jingpai/:id', 'v1.jingpai.jingpaiProduct/get_product_info')->option(['real_name' => '竞拍详情']);
    //加入回收站
    Route::delete('jingpai/:id', 'v1.jingpai.jingpaiProduct/delete')->option(['real_name' => '竞拍放入回收站']);
    //保存新建或保存
    Route::post('jingpai/:id', 'v1.jingpai.jingpaiProduct/save')->option(['real_name' => '新建或修改竞拍']);
    //修改竞拍状态
    Route::put('jingpai/set_show/:id/:is_show', 'v1.jingpai.jingpaiProduct/set_show')->option(['real_name' => '修改竞拍状态']);
    //竞拍快速编辑
    Route::put('jingpai/set_jingpai/:id', 'v1.jingpai.jingpaiProduct/set_product')->option(['real_name' => '竞拍快速编辑']);
    //设置批量竞拍上架
    Route::put('jingpai/jingpai_show', 'v1.jingpai.jingpaiProduct/product_show')->option(['real_name' => '设置批量竞拍上架']);
    //设置批量竞拍下架
    Route::put('jingpai/jingpai_unshow', 'v1.jingpai.jingpaiProduct/product_unshow')->option(['real_name' => '设置批量竞拍下架']);
    //规则列表
    Route::get('jingpai/rule', 'v1.jingpai.jingpaiProductRule/index')->option(['real_name' => '竞拍规则列表']);
    //规则 保存新建或编辑
    Route::post('jingpai/rule/:id', 'v1.jingpai.jingpaiProductRule/save')->option(['real_name' => '新建或编辑竞拍规则']);
    //规则详情
    Route::get('jingpai/rule/:id', 'v1.jingpai.jingpaiProductRule/read')->option(['real_name' => '竞拍规则详情']);
    //删除属性规则
    Route::delete('jingpai/rule/delete', 'v1.jingpai.jingpaiProductRule/delete')->option(['real_name' => '删除竞拍规则']);
    //生成属性
    Route::post('generate_attr/:id/:type', 'v1.jingpai.jingpaiProduct/is_format_attr')->option(['real_name' => '生成竞拍规格列表']);
    //评论列表
    Route::get('reply', 'v1.jingpai.jingpaiProductReply/index')->option(['real_name' => '竞拍评论列表']);
    //回复评论
    Route::put('reply/set_reply/:id', 'v1.jingpai.jingpaiProductReply/set_reply')->option(['real_name' => '竞拍回复评论']);
    //删除评论
    Route::delete('reply/:id', 'v1.jingpai.jingpaiProductReply/delete')->option(['real_name' => '删除竞拍评论']);
    //获取竞拍数据
    Route::post('crawl', 'v1.jingpai.CopyTaobao/get_request_contents')->option(['real_name' => '获取采集竞拍数据']);
    //获取复制竞拍配置
    Route::get('copy_config', 'v1.jingpai.CopyTaobao/getConfig')->option(['real_name' => '获取复制竞拍配置']);
    //复制其他平台竞拍
    Route::post('copy', 'v1.jingpai.CopyTaobao/copyProduct')->option(['real_name' => '复制其他平台竞拍']);
    //保存竞拍数据
    Route::post('crawl/save', 'v1.jingpai.CopyTaobao/save_product')->option(['real_name' => '保存采集竞拍数据']);
    //调起虚拟评论表单
    Route::get('reply/fictitious_reply/:jingpai_id', 'v1.jingpai.jingpaiProductReply/fictitious_reply')->option(['real_name' => '虚拟评论表单']);
    //保存虚拟评论
    Route::post('reply/save_fictitious_reply', 'v1.jingpai.jingpaiProductReply/save_fictitious_reply')->option(['real_name' => '保存虚拟评论']);
    //获取规则属性模板
    Route::get('jingpai/get_rule', 'v1.jingpai.jingpaiProduct/get_rule')->option(['real_name' => '获取竞拍规则属性模板']);
    //获取运费模板
    Route::get('jingpai/get_template', 'v1.jingpai.jingpaiProduct/get_template')->option(['real_name' => '获取运费模板']);
    //上传视频密钥接口
    Route::get('jingpai/get_temp_keys', 'v1.jingpai.jingpaiProduct/getTempKeys')->option(['real_name' => '上传视频密钥接口']);
    //检测是否有活动开启
    Route::get('jingpai/check_activity/:id', 'v1.jingpai.jingpaiProduct/check_activity')->option(['real_name' => '检测是竞拍否有活动开启']);
    //导入虚拟竞拍卡密
    Route::get('jingpai/import_card', 'v1.jingpai.jingpaiProduct/import_card')->option(['real_name' => '导入虚拟竞拍卡密']);
})->middleware([
    \app\http\middleware\AllowOriginMiddleware::class,
    \app\adminapi\middleware\AdminAuthTokenMiddleware::class,
    \app\adminapi\middleware\AdminCkeckRoleMiddleware::class,
    \app\adminapi\middleware\AdminLogMiddleware::class
]);
